package test.processor;

import org.springframework.batch.item.ItemProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import test.pojo.Person;
import test.pojo.SysLog;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : example
 * @ Author: XuLeHuang
 * @ Date: 2022/8/3 9:09
 * @ Description:
 */
@Configuration
public class MyProcessor {
    private static final String IS_EXIT = "0";

    @Bean
    public ItemProcessor<Person, Person> itemProcessor() {
        ItemProcessor<Person, Person> personItemProcessor = new ItemProcessor<Person, Person>() {
            @Override
            public Person process(Person person) throws Exception {
                return person;
//                String delFlag = person.getDelFlag();
               /* if (IS_EXIT.equals(delFlag)) {
                    return sysLog;
                } else {
                    return null;
                }*/
            }
        };
        return personItemProcessor;
    }
}
